package
{
	import capricornus.components.utils.mouse.MouseUtils;
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.utils.getTimer;
	
	[SWF(frameRate="50")]
	public class MouseTest extends Sprite
	{
		public function MouseTest()
		{
			super();
			init();
		}
		
		private function init():void
		{
			var s:Sprite = new Sprite();
			s.graphics.beginFill( 0 );
			s.graphics.drawRect( 0, 0, 80, 20 );
			s.graphics.endFill();
			s.x = 30;
			s.y = 30;
			addChild( s );
			s.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDown );
			MouseUtils.addPress( s );
		}
		
		private var _last:int = 0;
		private function onMouseDown( e:MouseEvent ):void
		{
			var t:int = getTimer();
			trace( t - _last, "mouse down" );
			_last = t;
		}
	}
}